package com.ruoyi.financial.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.financial.vo.FCustomerVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.financial.mapper.FCustomerMapper;
import com.ruoyi.financial.domain.FCustomer;
import com.ruoyi.financial.service.IFCustomerService;

/**
 * 客户Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-06
 */
@Service
public class FCustomerServiceImpl implements IFCustomerService 
{
    @Autowired
    private FCustomerMapper fCustomerMapper;

    /**
     * 查询客户
     * 
     * @param id 客户主键
     * @return 客户
     */
    @Override
    public FCustomer selectFCustomerById(Long id)
    {
        return fCustomerMapper.selectFCustomerById(id);
    }

    /**
     * 查询客户列表
     * 
     * @param fCustomer 客户
     * @return 客户
     */
    @Override
    public List<FCustomer> selectFCustomerList(FCustomer fCustomer)
    {
        return fCustomerMapper.selectFCustomerList(fCustomer);
    }

    /**
     * 新增客户
     * 
     * @param fCustomer 客户
     * @return 结果
     */
    @Override
    public int insertFCustomer(FCustomer fCustomer)
    {
        fCustomer.setCreateTime(DateUtils.getNowDate());
        return fCustomerMapper.insertFCustomer(fCustomer);
    }

    /**
     * 修改客户
     * 
     * @param fCustomer 客户
     * @return 结果
     */
    @Override
    public int updateFCustomer(FCustomer fCustomer)
    {
        fCustomer.setUpdateTime(DateUtils.getNowDate());
        return fCustomerMapper.updateFCustomer(fCustomer);
    }

    /**
     * 批量删除客户
     * 
     * @param ids 需要删除的客户主键
     * @return 结果
     */
    @Override
    public int deleteFCustomerByIds(Long[] ids)
    {
        return fCustomerMapper.deleteFCustomerByIds(ids);
    }

    /**
     * 删除客户信息
     * 
     * @param id 客户主键
     * @return 结果
     */
    @Override
    public int deleteFCustomerById(Long id)
    {
        return fCustomerMapper.deleteFCustomerById(id);
    }
}
